<!DOCTYPE html>
<html>
<#include "../../common/header.ftl">
<script src="${basePath}/js/appUser/list.js?v=201711021700"></script>

<head>
<meta charset="UTF-8">
<title>app用户管理</title>
<style>
	.left{
		float:left;
		min-width:100px;
		margin-left: 10px;
	}
	.table-margin{
		margin:5px 3%;
		width:92%;
	}
</style>

</head>
<body>
   
<div class="container" style="margin-left:5%;width:90%">
	<form class="layui-form left" action="#" >
		<div class="layui-form-item ">
			<label class="layui-form-label left">用户等级</label>
		    <div class="layui-input-block left">
		      <select name="gradeId" >
		        <option value="">所有</option>
		        <option value="">所有</option>
		        <#list gradeList! as grade>
		       		<option value="${grade.id}" <#if param.gradeId?? && (param.gradeId==grade.id)> selected</#if>>${grade.name}</option>
		        
		        </#list>
		      </select>
		    </div>
		    <div class="layui-input-block left">
		      <input type="text" name="keyword" value="${param.keyword!}"   placeholder="昵称/手机号"  
		      class="layui-input" style="width:400px;margin-right:200px;margin-left:30px">
		    </div>
		     <div class="layui-input-block left">
		      <button type="button" class="layui-btn"  id="search-button">搜索</button>
		      <#if permission?? && (permission.P506??)>
		      	<button type="button" class="layui-btn"  id="updateGrade-button">更新用户等级</button>
		      </#if>
		    </div>
		</div>
	</form>
</div>
<table class="table table-margin">
  <thead>
      <tr>
      	 <th><input type="checkBox" onclick="checkAll(this)"></th>
         <th>昵称</th>
         <th>头像</th>
         <th>手机号</th>
         <th>会员等级</th>
         <th>余额</th>
         <th>注册时间</th>
         <th>最后登录时间</th>
         <th>账号状态</th>
         <th>操作</th>
      </tr>
  </thead>
  <tbody>
	<#list page.itemList! as user>
		<tr>
			<td><input type="checkbox" class="user-checkbox" value="${user.userId!}" ></td>
			<td>${user.nickname!}</td>
			<td>
			<#if user.headIcon??>
				<img  src="${imgUrl+user.headIcon}" height="50px" width="50px" 
				 data-toggle="modal" data-target="#imgModal" onerror="this.src='${basePath}/images/default_goods.jpg'" />
			<#else>
				<img  src="${basePath}/images/default_goods.jpg" height="50px" width="50px"  data-toggle="modal" data-target="#imgModal"/> 
			</#if>
			</td>
			<td>${user.mobileNo!}</td>
			<td>${user.gradeName!}</td>
			<td>${user.money?string('#0.00')}</td>
			<td>${user.registerTime!}</td>
			<td>${user.lastLoginTime!}</td>
			<td><#if user.isValide?? && user.isValide == 0>禁用
			    <#elseif user.isValide?? && user.isValide == 1>正常
				<#else>状态异常</#if>
			</td>
			<td >
			<div class="btn-group ">
			  <button type="button" class="btn btn-primary dropdown-toggle " data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
			    	操作<span class="caret"></span>
			  </button>
			  <ul class="dropdown-menu">
			    <#if permission?? && (permission.P504??)>
			    <li><a href="javascript:void(0);" onclick="editMoneyFun('${user.userId}','1')">充值</a></li>
			    <li><a href="javascript:void(0);" onclick="editMoneyFun('${user.userId}','3')">提现</a></li>
			    </#if>
			    <#if permission?? && (permission.P503??)>
			    <li><a href="javascript:void(0);" onclick="moneyListFun('${user.userId}')">余额记录</a></li>
			    </#if>
			  </ul>
			</div>
			</td>
		</tr>
	</#list>
  </tbody>
</table>
	<#-- 翻页模块代码 -->
	<ul class="pager">
		<li><a href="javascript:void(0);" onclick="fanye('1')">首页</a></li>
		<#if (page.pageNo>1) > 
		<li><a	href="javascript:void(0);" onclick="fanye('${page.prevPage}')">上一页</a></li>
		<#else>
		<li><a href="javascript:void(0);">上一页</a></li> 
		</#if>
		<li><a href="javascript:void(0);">第${page.pageNo}页/共${page.totalPage}页</a></li>
		<#if (page.nextPage>page.pageNo) >
		<li><a href="javascript:void(0);" onclick="fanye('${page.nextPage}')">下一页</a></li>
		<#else>
		<li><a href="javascript:void(0);">下一页</a></li>
		</#if>
		<li><a href="javascript:void(0);" onclick="fanye('${page.totalPage}')">尾页</a></li>
	</ul>
  
</body>
<script type="text/javascript">
	var basePath="${basePath}";
	var init={
	    gradeId:"${param.gradeId!}",
		keyword:"${param.keyword!}"
	}
	$(function(){
		layui.use(['form', 'layer'] , function(){
		  var layer = layui.layer;
		  var form = layui.form(); 
	});
});
</script>
</html>